package com.minelx.landisk.filesystem.core.init;

import com.minelx.landisk.filesystem.core.Path;

public enum PathType {
	FILE {
		@Override
		public void delete(Path path) {
			path.getPathMethodProvider().deleteFile();
		}

		@Override
		public void create(Path path) {
			path.getPathMethodProvider().createFile();
		}

		@Override
		public boolean isMatch(Path path) {
			return path.getPathMethodProvider().isFile();
		}

		@Override
		public String friendlyName() {
			return "file";
		}

	}, DIR {
		@Override
		public void delete(Path path) {
			path.getPathMethodProvider().deleteDirectory();
		}

		@Override
		public void create(Path path) {
			path.getPathMethodProvider().createDirectory();
		}

		@Override
		public boolean isMatch(Path path) {
			return path.getPathMethodProvider().isDirectory();
		}

		@Override
		public String friendlyName() {
			return "directory";
		}
	};

	public abstract void delete(Path path);

	public abstract void create(Path path);

	public abstract boolean isMatch(Path path);

	public abstract String friendlyName();
}
